const {app, BrowserWindow} = require('electron');
const {create:createMainWindow} = require('./main-process/create-media-win'); //创建一个主窗口
// const handleIPC=require('./main-process/ipc')//处理主进程的事务放在同一个文件
const robot =  require('./main-process/robot');
let mainWindow = null;
app.allowRendererProcessReuse = false;
app.on('ready', () => {
    require('./main-process/menu');
    robot();
    mainWindow = new BrowserWindow({
        width: 600,
        height: 600,
        webPreferences: {
            nodeIntegration: true,
            enableRemoteModule: true
        }
    });
    mainWindow.webContents.openDevTools();
    mainWindow.loadFile('./template/index.html');
    mainWindow.on('close', () => {
        mainWindow = null;
    });
});

// app.on('ready',()=>{
//     // handleIPC()
//     createMainWindow(); // 主窗口出现APP.js的页面
// });





